import { message } from "antd";
export default (url: string, cfg: object, history, callback: Function) => {
  fetch(url, cfg)
    .then(resp => resp.json())
    .then(resp => {
      console.log(resp);
      if (resp.code == 200) {
        message.error("AUTH ERROR");
        history.push("/retailers/login");
        return;
      }
      callback(resp);
    });
};
